{extend name='common/container'}
{block name="content"}
<div style="margin:0 15px 15px 15px;">
    <el-card shadow="never" style="min-height:650px;">


        <el-table row-key="id"  :header-cell-style="{ background: '#eef1f6', color: '#606266' }" v-loading="loading"  ref="multipleTable" border class="eltable" :data="list" show-summary style="width: 100%">
            <el-table-column align="center" type="selection" width="42"></el-table-column>
            <el-table-column align="center" type = '' property="id"  label="编号"  width="70">
            </el-table-column>
            <el-table-column align="center"  property="user" label="用户" width="200">
            </el-table-column>
            <el-table-column align="center"  property="type" :formatter="currency" label="币种">
            </el-table-column>
            <el-table-column align="center"  property="money" label="参与数量">
            </el-table-column>
            <el-table-column align="center" sortable property="multiple" label="奖励倍数">
            </el-table-column>
            <el-table-column align="center" sortable property="bonus" label="返回的奖励点">
            </el-table-column>
            <el-table-column align="center" sortable property="returned" label="已返回数量">
            </el-table-column>
            <el-table-column align="center"  property="pay_type" :formatter="pay_type" label="支付方式">
            </el-table-column>
            <el-table-column align="center"  property="status" :formatter="status" label="状态">
            </el-table-column>
            <el-table-column align="center"  property="add_time" label="添加时间">
            </el-table-column>
            <el-table-column align="center"  property="update_time" label="更新时间">
            </el-table-column>
<!--            <el-table-column :fixed="ismobile()?false:'right'" label="操作" align="center" width="180">-->
<!--                <template slot-scope="scope">-->
<!--                    <div v-if="scope.row.id">-->
<!--                        <el-button v-if="checkPermission('/admin/Charitable/delete.html','{:implode(",",session("admin.access"))}','{:session("admin.role_id")}',[1])" size="mini" icon="el-icon-delete" type="danger" @click="del(scope.row)" >删除</el-button>-->
<!--                    </div>-->
<!--                </template>-->
<!--            </el-table-column>-->
        </el-table>
        <Page :total="page_data.total" :page.sync="page_data.page" :limit.sync="page_data.limit" @pagination="index" />
    </el-card>


</div>

{/block}
{block name="script"}
<script src="__PUBLIC__/assets/js/app.js"></script>
<script src="__PUBLIC__/assets/libs/xlsx/xlsx.core.min.js"></script>
<script src="__PUBLIC__/components/admin/member_level/add.js?v=<?php echo rand(1000,9999)?>"></script>
<script src="__PUBLIC__/components/admin/member_level/update.js?v=<?php echo rand(1000,9999)?>"></script>
<script>
    new Vue({
        el: '#app',
        components:{
        },
        data: function() {
            return {
                dialog: {
                    addDialogStatus : false,
                    updateDialogStatus : false,
                    resetPwdDialogStatus : false,
                },
                searchData:{},
                loading: false,
                list:[],
                updateInfo:{},
                page_data: {
                    limit: 20,
                    page: 1,
                    total:20,
                },

            }
        },
        methods:{
            index(){
                let param = {limit:this.page_data.limit,page:this.page_data.page,order:this.order,sort:this.sort}
                Object.assign(param, this.searchData,this.urlobj)
                this.loading = true
                axios.post(base_url + '/Matrix/index',param).then(res => {
                    if(res.data.status == 200){
                        this.list = res.data.data.data
                        this.page_data.total = res.data.data.total
                        this.sum_amount = res.data.sum_amount
                        this.loading = false
                    }else{
                        this.$message.error(res.data.msg);
                    }
                })
            },
            del(row){
                this.$confirm('确定操作吗?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    let ids = row.id ? row.id : this.ids.join(',')
                    axios.post(base_url + '/Matrix/delete',{id:ids}).then(res => {
                        if(res.data.status == 200){
                            this.$message({message: res.data.msg, type: 'success'})
                            this.index()
                        }else{
                            this.$message.error(res.data.msg)
                        }
                    })
                }).catch(() => {})
            },
            fn(method){
                this[method](this.ids)
            },
            currency(row, column, cellValue){
                if (cellValue === 1){
                    return 'USDT';
                }
                if (cellValue === 2){
                    return 'MMST';
                }
            },
            status(row, column, cellValue){
                if (cellValue === 1){
                    return '支付中';
                }
                if (cellValue === 2){
                    return '已支付';
                }
                if (cellValue === 3){
                    return '已结束';
                }
            },
            pay_type(row, column, cellValue){
                if (cellValue === 1){
                    return '余额';
                }
                if (cellValue === 2){
                    return '链钱包';
                }
            },
        },
        mounted(){
            this.index()
        },
    })
</script>
{/block}
